Is it safe to override `release` for debugging?

Posted by Koning Baard XIV on Stack Overflow See other posts from Stack Overflow or by Koning Baard XIV
Published on 2010-04-18T12:26:21Z Indexed on 2010/04/18 12:33 UTC
Read the original article Hit count: 451

Sometimes I need to find out if an object will really be released. I could use Instruments of course, but that takes much time, and I have to search into millions of objects, so I used to do this:

-(void)release {
    NSLog("I'm released");
    [super release];
}

But the problem is: is this safe to do? Can I get any problems when I override -(void)release. Also, is it really void? And what if I build my application for distribution, but per accident leave it there? Or is it just safe? Thanks

© Stack Overflow or respective owner

Related posts about release

Related posts about objective-c